//package com.easipass.epug.controller;
//
//import com.easipass.epug.dao.UserDao;
//import com.easipass.epug.entity.User;
//import com.easipass.epug.service.UserService;
//import org.springframework.core.env.SystemEnvironmentPropertySource;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.net.URLDecoder;
//import java.util.List;
//
///**
// * Created by Wangxuyang on 16/6/5.
// */
//@Controller
//@RequestMapping("/user")
//public class UserController {
//    @Resource(name="userService")
//    private UserService userService;
//
////    public UserService getUserService() {
////        return userService;
////    }
////
////    public void setUserService(UserService userService) {
////        this.userService = userService;
////    }
//
//    @RequestMapping("/addUser")
//    public String addUser(User user,HttpServletRequest request){
//        userService.addUser(user);
//        List<User> users = this.userService.getAllUsers();
//        request.setAttribute("users", users);
//        return "user";
//    }
//
//    @RequestMapping("/getAllUsers")
//    public String getAllUsers(HttpServletRequest request)
//    {
//        List<User> users = this.userService.getAllUsers();
//        request.setAttribute("users", users);
//        return "user";
//    }
//
//    @RequestMapping("/delUser")
//    public String delUser(String id,HttpServletRequest request)
//    {
//        this.userService.del(id);
//        List<User> users = this.userService.getAllUsers();
//        request.setAttribute("users", users);
//        return "user";
//    }
//    @RequestMapping("/updateUser")
//    public String updateUser(User user,HttpServletRequest request)
//    {
//        this.userService.update(user);
//        List<User> users = this.userService.getAllUsers();
//        request.setAttribute("users", users);
//        return "user";
//
//    }
//    @RequestMapping("/updateUserById")
//    public String getUserById(String id,HttpServletRequest request)
//    {
//        List<User> users = this.userService.getUserById(id);
//        request.setAttribute("user", users.get(0));
//        return "getUser";
//    }
//}
